using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Azure;
using Microsoft.AspNetCore.Mvc;
using ShopForWeb.Dtos.ViewModel;
using ShopForWeb.Services;

namespace ShopForWeb.Api.Controllers.User
{
  [ApiController]
  [Route("api/User/[controller]")]
  public class ProductController : ControllerBase
  {
    private ProductServices _productservices;

    public ProductController(ProductServices productServices)
    {
      this._productservices = productServices;
    }
    [HttpGet("page")]
    public async Task<ResponseView> GetPageAsync([FromQuery] int page = 1, int size = 12)
    {
      var result = new ResponseView()
      {
        Code = 200,
        Data = await this._productservices.GetPageAsync(page, size)
      };
      return result;
    }
  }
}
